<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:pe="http://primefaces.org/ui/extensions"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:fn="http://java.sun.com/jsp/jstl/functions">
    <ui:composition template="/layout/masterPageNotHeaderSearch.xhtml">
        <f:metadata>

            <f:event type="preRenderView" listener="#{sys_NguoiDungController.onPageLoad_CheckUsers()}">

            </f:event>

        </f:metadata>

        <ui:define name="ui-header">
            <title>#{utilsController.getLanguages("TaoMoiCapNhatTinBan")}</title>
        </ui:define>


        <ui:define name="ui-content">
            <div class="container content">
                <div class="heading heading-v1 margin-bottom-50">
                    <h2 class="headerColor" style="font-size: 35px;">#{utilsController.getLanguages("TinBan")}</h2>
                </div>
                <div class="row">
                    <div class="panel panel-grey" style="border: none">
                        <div class="panel-heading">
                            <h3 class="panel-title">
                                <button class="btn-u btn-u-dark rounded-custom-def" onclick="btnSave_DangTin_Click();">
                                    <i class="fa fa-save"></i> #{utilsController.getLanguages('Save')}</button>
                                <a href="/Users/c/list-ad.html" class="btn-u btn-u-red rounded-custom-def">
                                    <i class="fa fa-times-circle"></i> #{utilsController.getLanguages('Cancel')}</a>
                            </h3>
                        </div>
                        <div class="panel-body"> 
                            <h:form styleClass="margin-bottom-40 sky-form" id="frmdangtin">
                                <p:growl id="growl" showDetail="true" sticky="true" escape="false" />  
                                <div class="col-md-8">
                                    <div class="row">
                                        <div class="col-md-12" style="padding: 0px;margin-bottom: 10px">
                                            <h2 class="headerColor" style="font-size: 28px">#{utilsController.getLanguages("ThongTinCoBan")}</h2>
                                            <div class="col-md-6">
                                                <c:set var="lstNamSanXuat" value="#{c_DangTinController.findAllNamSanXuat()}" scope="session"></c:set>
                                                <label for="cboNamSanXuat">#{utilsController.getLanguages("NamSanXuat")}(<span style="color: red;">*</span>)</label>
                                                <label class="select">
                                                    <select id="cboNamSanXuat" class="rounded-custom-def" value="#{c_DangTinController.item.namSanXuat}">
                                                        <c:forEach items="#{lstNamSanXuat}" var="item">
                                                            <option value="#{item}">#{item}</option>
                                                        </c:forEach>
                                                        <option value="-1">#{utilsController.getLanguages("XaHon")}</option>
                                                    </select>
                                                    <i></i>
                                                </label>
                                            </div>
                                            <div class="col-md-6">
                                                <label for="txtSoVIN">#{utilsController.getLanguages("SoVIN")} (<span style="color: red;">*</span>)</label>
                                                <input id="txtSoVIN" class="form-control rounded-custom-def" value="#{c_DangTinController.item.soVIN}" />
                                            </div>
                                        </div>
                                        <div class="col-md-12" style="padding: 0px;margin-bottom: 10px">
                                            <div class="col-md-6">
                                                <c:set var="lstHangXe" value="#{c_DangTinController.findAllHangXe()}" scope="session"></c:set>
                                                <label for="cboHangXeID">#{utilsController.getLanguages("HangXe")}(<span style="color: red;">*</span>)</label>
                                                <label class="select">
                                                    <select id="cboHangXeID" class="rounded-custom-def" onchange="getListDoiXe();" value="#{c_DangTinController.item.hangXeID}">
                                                        <c:forEach items="#{lstHangXe}" var="item">
                                                            <option  value="#{item.getID()}">#{item.getTenHang()}</option>
                                                        </c:forEach>                                                                    
                                                    </select>
                                                    <i></i>
                                                </label>
                                            </div>
                                            <div class="col-md-6">
                                                <label for="txtSoDaDiKM">#{utilsController.getLanguages("SoKMDaDi")} (<span style="color: red;">*</span>)</label>
                                                <input id="txtSoDaDiKM" class="form-control rounded-custom-def" value="#{c_DangTinController.item.soDaDiKM}" />
                                            </div>
                                        </div>
                                        <div class="col-md-12" style="padding: 0px;margin-bottom: 10px">
                                            <div class="col-md-6">
                                                <p:outputPanel id="pnDoiXe">
                                                    <c:set var="lstDoiXe" value="#{c_DangTinController.findAllDoiXe()}" scope="session"></c:set>
                                                    <label for="cboDoiXeID">#{utilsController.getLanguages("DoiXe")} (<span style="color: red;">*</span>)</label>
                                                    <label class="select">
                                                        <select id="cboDoiXeID" class="rounded-custom-def" value="#{c_DangTinController.item.doiXeID}">
                                                            <c:forEach items="#{lstDoiXe}" var="item">
                                                                <option value="#{item.getID()}">#{item.getDoiXe()}</option>
                                                            </c:forEach>
                                                           
                                                        </select>
                                                        <i></i>
                                                    </label>
                                                </p:outputPanel>
                                            </div>
                                            <div class="col-md-6">
                                                <c:set var="lstMauXe" value="#{c_DangTinController.findAllMauXe()}" scope="session"></c:set>
                                                <label for="cboMauXeID">#{utilsController.getLanguages("MauXe")}</label>
                                                <label class="select">
                                                    <select id="cboMauXeID" class="rounded-custom-def" value="#{c_DangTinController.item.mauXeID}">
                                                        <c:forEach items="#{lstMauXe}" var="item">
                                                            <option value="#{item.getID()}">#{utilsController.getLanguages(item.getMaMau())}</option>
                                                        </c:forEach>
                                                    </select>
                                                    <i></i>
                                                </label>
                                            </div>
                                        </div>
                                        <div class="col-md-12" style="padding: 0px;margin-bottom: 10px">
                                            <div class="col-md-6">
                                                <label for="txtPhanHangDoiXe">#{utilsController.getLanguages("PhanHangDoiXe")}</label>
                                                <input id="txtPhanHangDoiXe" class="form-control rounded-custom-def" value="#{c_DangTinController.item.phanHangDoiXe}" />
                                            </div>
                                            <div class="col-md-6">
                                                <label for="cboMauNoiThatID">#{utilsController.getLanguages("MauNoiThat")}</label>
                                                <label class="select">
                                                    <select id="cboMauNoiThatID" class="rounded-custom-def" value="#{c_DangTinController.item.mauNoiThatID}">
                                                        <c:forEach items="#{lstMauXe}" var="item">
                                                            <option value="#{item.getID()}">#{utilsController.getLanguages(item.getMaMau())}</option>
                                                        </c:forEach>
                                                    </select>
                                                    <i></i>
                                                </label>
                                            </div>
                                        </div>
                                        <div class="col-md-12" style="padding: 0px;margin-bottom: 10px">
                                            <div class="col-md-6">
                                                <c:set var="lstDongXe" value="#{c_DangTinController.findAllDongXe()}" scope="session"></c:set>
                                                <label for="cboDongXeID">#{utilsController.getLanguages("DongXe")}</label>
                                                <label class="select">
                                                    <select id="cboDongXeID" class="rounded-custom-def" value="#{c_DangTinController.item.dongXeID}">
                                                        <c:forEach items="#{lstDongXe}" var="item">
                                                            <option value="#{item.getID()}">#{item.getDongXe()}</option>
                                                        </c:forEach>
                                                        <option value="0">#{utilsController.getLanguages("Khac")}</option>
                                                    </select>
                                                    <i></i>
                                                </label>
                                            </div>
                                            <div class="col-md-6">
                                                <label for="cboHopSo">#{utilsController.getLanguages("HopSo")}</label>
                                                <label class="select">
                                                    <select id="cboHopSo" class="rounded-custom-def" value="#{c_DangTinController.item.hopSo}">
                                                        <option  value="1">#{utilsController.getLanguages("SoTay")}</option>
                                                        <option  value="2">#{utilsController.getLanguages("TuDong")}</option>
                                                        <option  value="3">#{utilsController.getLanguages("BanTuDong")}</option>
                                                        <option  value="4">#{utilsController.getLanguages("SoHonHop")}</option>
                                                        <option  value="0">#{utilsController.getLanguages("Khac")}</option>
                                                    </select>
                                                    <i></i>
                                                </label>
                                            </div>
                                        </div>
                                        <div class="col-md-12" style="padding: 0px;margin-bottom: 10px">
                                            <div class="col-md-6">
                                                <label for="txtSoCua">#{utilsController.getLanguages("SoCua")} (<span style="color: red;">*</span>)</label>
                                                <input id="txtSoCua" class="form-control rounded-custom-def" value="#{c_DangTinController.item.soCua}" />
                                            </div>
                                            <div class="col-md-6">
                                                <label for="cboKieuDanDong">#{utilsController.getLanguages("KieuDanDong")}</label>
                                                <label class="select">
                                                    <select id="cboKieuDanDong" class="rounded-custom-def" value="#{c_DangTinController.item.kieuDanDong}">
                                                        <option  value="1">#{utilsController.getLanguages("FWD")}</option>
                                                        <option  value="2">#{utilsController.getLanguages("RFD")}</option>
                                                        <option  value="3">#{utilsController.getLanguages("4WD")}</option>
                                                        <option  value="4">#{utilsController.getLanguages("AWD")}</option>
                                                        <option  value="5">#{utilsController.getLanguages("4WDHoacAWD")}</option>
                                                        <option  value="0">#{utilsController.getLanguages("Khac")}</option>
                                                    </select>
                                                    <i></i>
                                                </label>
                                            </div>
                                        </div>
                                        <div class="col-md-12" style="padding: 0px;margin-bottom: 10px">
                                            <div class="col-md-6">
                                                <label for="txtKieuDongCo">#{utilsController.getLanguages("KieuDongCo")}</label>
                                                <input id="txtKieuDongCo" class="form-control rounded-custom-def" value="#{c_DangTinController.item.kieuDongCo}" />
                                            </div>
                                            <div class="col-md-6">
                                                <label for="cboNhienLieu">#{utilsController.getLanguages("NhienLieu")}</label>
                                                <label class="select">
                                                    <select id="cboNhienLieu" class="rounded-custom-def" value="#{c_DangTinController.item.nhienLieu}">
                                                        <option  value="1">#{utilsController.getLanguages("Xang")}</option>
                                                        <option  value="2">#{utilsController.getLanguages("Dau")}</option>
                                                        <option  value="3">#{utilsController.getLanguages("XeChayDien")}</option>
                                                        <option  value="4">#{utilsController.getLanguages("Hydrid")}</option>
                                                        <option  value="5">#{utilsController.getLanguages("Diesel")}</option>
                                                        <option  value="0">#{utilsController.getLanguages("Khac")}</option>
                                                    </select>
                                                    <i></i>
                                                </label>
                                            </div>
                                        </div>
                                        <div class="col-md-12 margin-bottom-40" style="margin-bottom: 0px"><hr/></div>
                                        <div class="col-md-12" style="padding: 0px;margin-bottom: 10px">
                                            <h2 class="headerColor" style="font-size: 28px">#{utilsController.getLanguages("NoiDangTin")}</h2>
                                            <div class="col-md-6">
                                                <c:set var="lstQuocGia" value="#{sI_QuocGiaController.findAllQuocGia()}" scope="session"></c:set>
                                                <label for="cboKhuVucDang_QuocGia">#{utilsController.getLanguages("QuocGia")}(<span style="color: red;">*</span>)</label>
                                                <label class="select">
                                                    <select id="cboKhuVucDang_QuocGia" class="rounded-custom-def" onchange="getListTinh();" value="#{c_DangTinController.item.khuVucDang_QuocGia}">
                                                        <c:forEach items="#{lstQuocGia}" var="item">
                                                            <option  value="#{item.getQuocGiaID()}" selected="#{(c_DangTinController.item.khuVucDang_QuocGia.trim()==item.getQuocGiaID()?'selected':'')}" >#{item.getTenQG()}</option>
                                                        </c:forEach>                                                                    
                                                    </select>
                                                    <i></i>
                                                </label>
                                            </div>
                                            <div class="col-md-6">
                                                <p:outputPanel id="pnTinh">
                                                    <c:set var="lstTinh" value="#{c_DangTinController.findAllTinh()}" scope="session"></c:set>
                                                    <label for="cboKhuVucDang_Tinh">#{utilsController.getLanguages("Tinh")} (<span style="color: red;">*</span>)</label>
                                                    <label class="select">
                                                        <select id="cboKhuVucDang_Tinh" class="rounded-custom-def" value="#{c_DangTinController.item.khuVucDang_Tinh}">
                                                            <c:forEach items="#{lstTinh}" var="item">
                                                                <option value="#{item.getTinhID()}">#{item.getTenTinh()}</option>
                                                            </c:forEach>
                                                        </select>
                                                        <i></i>
                                                    </label>
                                                </p:outputPanel>
                                            </div>
                                        </div>
                                        
                                        <c:if test="#{c_DangTinController.item.tuKhoaTimKiem=='1'}">
                                            <div class="col-md-12 margin-bottom-40" style="margin-bottom: 0px"><hr/></div>
                                            <div class="col-md-12" style="padding: 0px;margin-bottom: 10px">
                                                <h2 class="headerColor" style="font-size: 28px">#{utilsController.getLanguages("ChonCacTienNghi")}</h2>
                                                <c:set value="#{c_DangTinController.findAllThietBi()}" var="vThietBi" scope="session"></c:set>

                                                <c:forEach items="#{vThietBi}" var="item" varStatus="status">
                                                    <c:if test="#{item.getLoai()==1}">

                                                        <div class="col-md-6">
                                                            <h4 style="font-weight: bold;font-size: 17px;color: black">#{utilsController.getLanguages(item.getNhomThietBi())}</h4>
                                                            <c:forEach items="#{item.getItems()}" var="child">
                                                                <div class="col-md-12" style="padding: 0px;">
                                                                    <input type="checkbox" name="checkIds" id="#{child.getID()}" checked="#{child.getCheckBox()}" />
                                                                    <span style="font-size: 15px;line-height: 25px;">#{utilsController.getLanguages(child.getThietBi())}</span>
                                                                </div>
                                                            </c:forEach>
                                                        </div>
                                                        <c:if test="#{(status.index+1)%2==0}">
                                                            <div class="row" style="margin-bottom: 15px"></div>
                                                        </c:if>
                                                    </c:if>
                                                </c:forEach>
                                            </div>
                                        </c:if>
                                        <div class="col-md-12 margin-bottom-40" style="margin-bottom: 0px"><hr/></div>
                                        <div class="col-md-12" style="padding: 0px;margin-bottom: 10px">
                                            <h2 class="headerColor" style="font-size: 28px">#{utilsController.getLanguages("ThongTinMoTa")}</h2>
                                            <textarea class="form-control rounded-custom-def" id="txtMoTat" style="height: 200px;" >#{c_DangTinController.item.moTat}</textarea>
                                        </div>
                                        <div class="col-md-12 margin-bottom-40" style="margin-bottom: 0px"><hr/></div>
                                        <div class="col-md-12" style="padding: 0px;margin-bottom: 10px">
                                            <h2 class="headerColor" style="font-size: 28px">#{utilsController.getLanguages("ThongTinGiaBan")}</h2>
                                            <div class="col-md-3">
                                                <label for="txtGia">#{utilsController.getLanguages("GiaBan")} (<span style="color: red;">*</span>)</label>
                                                <input id="txtGia" class="form-control rounded-custom-def" value="#{utilsController.formatNumber(c_DangTinController.item.gia, '#,###.##')}" />
                                            </div>
                                            <div class="col-md-3">
                                                <c:set var="lstTienTe" value="#{sI_TienTeController.findAllTienTe()}" scope="session"></c:set>
                                                <label for="cboTienTeID">#{utilsController.getLanguages("TienTe")}(<span style="color: red;">*</span>)</label>
                                                <label class="select">
                                                    <select id="cboTienTeID" class="rounded-custom-def" value="#{c_DangTinController.item.tienTeID}">
                                                        <c:forEach items="#{lstTienTe}" var="item">
                                                            <option value="#{item.getTienTeID()}">#{item.getTienTe()}</option>
                                                        </c:forEach>
                                                    </select>
                                                    <i></i>
                                                </label>
                                            </div>
                                            <div class="col-md-6">
                                                <label for="cboLoaiGia">#{utilsController.getLanguages("LoaiGia")} (<span style="color: red;">*</span>)</label>
                                                <label class="select">
                                                    <select id="cboLoaiGia" class="rounded-custom-def" value="#{c_DangTinController.item.loaiGia}">
                                                        <option value="0">#{utilsController.getLanguages("ThoaThuan")}</option>
                                                        <option value="1">#{utilsController.getLanguages("CoDinh")}</option>
                                                    </select>
                                                    <i></i>
                                                </label>
                                            </div>
                                        </div>
                                        <div class="col-md-12 margin-bottom-40" style="margin-bottom: 0px"><hr/></div>
                                        <div class="col-md-12" style="padding: 0px;margin-bottom: 10px">
                                            <h2 class="headerColor" style="font-size: 28px">#{utilsController.getLanguages("ThongTinLienHe")}</h2>
                                            <div class="col-md-12" style="padding: 0px;margin-bottom: 10px">
                                                <div class="col-md-6">
                                                    <label for="txtLienHe_Ho">#{utilsController.getLanguages("Ho")} <span style="color: red;">(*)</span></label>
                                                    <input type="text" id="txtLienHe_Ho" class="form-control rounded-custom-def" value="#{c_DangTinController.item.lienHe_Ho.trim()}" />
                                                </div>
                                                <div class="col-md-6">
                                                    <label for="txtLienHe_Ten">#{utilsController.getLanguages("Ten")} <span style="color: red;">(*)</span></label>
                                                    <input type="text" id="txtLienHe_Ten" class="form-control rounded-custom-def" value="#{c_DangTinController.item.lienHe_Ten}" />
                                                </div>
                                            </div>
                                            <div class="col-md-12" style="padding: 0px;margin-bottom: 10px">
                                                <div class="col-md-6">
                                                    <label for="txtLienHe_Email">#{utilsController.getLanguages("Email")} <span style="color: red;">(*)</span></label>
                                                    <input type="text" id="txtLienHe_Email" class="form-control rounded-custom-def" value="#{c_DangTinController.item.lienHe_Email}" />
                                                </div>
                                                <div class="col-md-6">
                                                    <label for="txtLienHe_DienThoai">#{utilsController.getLanguages("DienThoai")} <span style="color: red;">(*)</span></label>
                                                    <input type="text" id="txtLienHe_DienThoai" class="form-control rounded-custom-def" value="#{c_DangTinController.item.lienHe_DienThoai}" />
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-12 margin-bottom-40" style="margin-bottom: 0px"><hr/></div>
                                        <div class="col-md-12" style="padding: 0px;margin-bottom: 10px">
                                            <h2 class="headerColor" style="font-size: 28px">#{utilsController.getLanguages("Photo")}</h2>
                                            <h:panelGroup layout="block" id="pnHinhAnh" styleClass="custom-input-group" style="padding-left: 15px">
                                                <p:fileUpload fileUploadListener="#{c_DangTinController.handleFileUpload}"  mode="advanced" dragDropSupport="false" auto="true"
                                                              style="display: none;visibility: hidden;" allowTypes="/(\.|\/)(gif|jpe?g|png)$/"    
                                                              update=":frmdangtin:pnHinhAnh"  />
                                                <input type="hidden" id="txtflagUpload" />
                                                <c:choose>
                                                    <c:when test="#{c_DangTinController.item.goiDangTinID==1}">
                                                        <a href="javascript:void(0)" onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(0).getID()}');">
                                                            <p:graphicImage onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(0).getID()}');" value="#{c_DangTinController.item.hinhAnh.get(0).getFileHinhAnh()==null?(c_DangTinController.item.hinhAnh.get(0).getHinhAnh().trim()==''?'/Data/UserUpload/default.jpg':c_DangTinController.getFullPathHinhAnh(c_DangTinController.item.hinhAnh.get(0).getHinhAnh())):c_DangTinController.item.hinhAnh.get(0).getFileHinhAnh()}"  cache="false">

                                                            </p:graphicImage>
                                                        </a>
                                                        <a href="javascript:void(0)" onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(1).getID()}');">
                                                            <p:graphicImage onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(1).getID()}');" value="#{c_DangTinController.item.hinhAnh.get(1).getFileHinhAnh()==null?(c_DangTinController.item.hinhAnh.get(1).getHinhAnh().trim()==''?'/Data/UserUpload/default.jpg':c_DangTinController.getFullPathHinhAnh(c_DangTinController.item.hinhAnh.get(1).getHinhAnh())):c_DangTinController.item.hinhAnh.get(1).getFileHinhAnh()}"  cache="false">

                                                            </p:graphicImage>
                                                        </a>
                                                        <a href="javascript:void(0)" onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(2).getID()}');">
                                                            <p:graphicImage onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(2).getID()}');" value="#{c_DangTinController.item.hinhAnh.get(2).getFileHinhAnh()==null?(c_DangTinController.item.hinhAnh.get(2).getHinhAnh().trim()==''?'/Data/UserUpload/default.jpg':c_DangTinController.getFullPathHinhAnh(c_DangTinController.item.hinhAnh.get(2).getHinhAnh())):c_DangTinController.item.hinhAnh.get(2).getFileHinhAnh()}"  cache="false">

                                                            </p:graphicImage>
                                                        </a>
                                                        <a href="javascript:void(0)" onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(3).getID()}');">
                                                            <p:graphicImage onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(3).getID()}');" value="#{c_DangTinController.item.hinhAnh.get(3).getFileHinhAnh()==null?(c_DangTinController.item.hinhAnh.get(3).getHinhAnh().trim()==''?'/Data/UserUpload/default.jpg':c_DangTinController.getFullPathHinhAnh(c_DangTinController.item.hinhAnh.get(3).getHinhAnh())):c_DangTinController.item.hinhAnh.get(3).getFileHinhAnh()}"  cache="false">

                                                            </p:graphicImage>
                                                        </a>
                                                        <a href="javascript:void(0)" onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(4).getID()}');">
                                                            <p:graphicImage onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(4).getID()}');" value="#{c_DangTinController.item.hinhAnh.get(4).getFileHinhAnh()==null?(c_DangTinController.item.hinhAnh.get(4).getHinhAnh().trim()==''?'/Data/UserUpload/default.jpg':c_DangTinController.getFullPathHinhAnh(c_DangTinController.item.hinhAnh.get(4).getHinhAnh())):c_DangTinController.item.hinhAnh.get(4).getFileHinhAnh()}"  cache="false">

                                                            </p:graphicImage>
                                                        </a>
                                                    </c:when>
                                                    <c:when test="#{c_DangTinController.item.goiDangTinID==2}">
                                                        <a href="javascript:void(0)" onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(0).getID()}');">
                                                            <p:graphicImage onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(0).getID()}');" value="#{c_DangTinController.item.hinhAnh.get(0).getFileHinhAnh()==null?(c_DangTinController.item.hinhAnh.get(0).getHinhAnh().trim()==''?'/Data/UserUpload/default.jpg':c_DangTinController.getFullPathHinhAnh(c_DangTinController.item.hinhAnh.get(0).getHinhAnh())):c_DangTinController.item.hinhAnh.get(0).getFileHinhAnh()}"  cache="false">

                                                            </p:graphicImage>
                                                        </a>
                                                        <a href="javascript:void(0)" onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(1).getID()}');">
                                                            <p:graphicImage onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(1).getID()}');" value="#{c_DangTinController.item.hinhAnh.get(1).getFileHinhAnh()==null?(c_DangTinController.item.hinhAnh.get(1).getHinhAnh().trim()==''?'/Data/UserUpload/default.jpg':c_DangTinController.getFullPathHinhAnh(c_DangTinController.item.hinhAnh.get(1).getHinhAnh())):c_DangTinController.item.hinhAnh.get(1).getFileHinhAnh()}"  cache="false">

                                                            </p:graphicImage>
                                                        </a>
                                                        <a href="javascript:void(0)" onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(2).getID()}');">
                                                            <p:graphicImage onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(2).getID()}');" value="#{c_DangTinController.item.hinhAnh.get(2).getFileHinhAnh()==null?(c_DangTinController.item.hinhAnh.get(2).getHinhAnh().trim()==''?'/Data/UserUpload/default.jpg':c_DangTinController.getFullPathHinhAnh(c_DangTinController.item.hinhAnh.get(2).getHinhAnh())):c_DangTinController.item.hinhAnh.get(2).getFileHinhAnh()}"  cache="false">

                                                            </p:graphicImage>
                                                        </a>
                                                        <a href="javascript:void(0)" onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(3).getID()}');">
                                                            <p:graphicImage onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(3).getID()}');" value="#{c_DangTinController.item.hinhAnh.get(3).getFileHinhAnh()==null?(c_DangTinController.item.hinhAnh.get(3).getHinhAnh().trim()==''?'/Data/UserUpload/default.jpg':c_DangTinController.getFullPathHinhAnh(c_DangTinController.item.hinhAnh.get(3).getHinhAnh())):c_DangTinController.item.hinhAnh.get(3).getFileHinhAnh()}"  cache="false">

                                                            </p:graphicImage>
                                                        </a>
                                                        <a href="javascript:void(0)" onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(4).getID()}');">
                                                            <p:graphicImage onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(4).getID()}');" value="#{c_DangTinController.item.hinhAnh.get(4).getFileHinhAnh()==null?(c_DangTinController.item.hinhAnh.get(4).getHinhAnh().trim()==''?'/Data/UserUpload/default.jpg':c_DangTinController.getFullPathHinhAnh(c_DangTinController.item.hinhAnh.get(4).getHinhAnh())):c_DangTinController.item.hinhAnh.get(4).getFileHinhAnh()}"  cache="false">

                                                            </p:graphicImage>
                                                        </a>

                                                        <a href="javascript:void(0)" onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(5).getID()}');">
                                                            <p:graphicImage onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(5).getID()}');" value="#{c_DangTinController.item.hinhAnh.get(5).getFileHinhAnh()==null?(c_DangTinController.item.hinhAnh.get(5).getHinhAnh().trim()==''?'/Data/UserUpload/default.jpg':c_DangTinController.getFullPathHinhAnh(c_DangTinController.item.hinhAnh.get(5).getHinhAnh())):c_DangTinController.item.hinhAnh.get(5).getFileHinhAnh()}"  cache="false">

                                                            </p:graphicImage>
                                                        </a>
                                                        <a href="javascript:void(0)" onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(6).getID()}');">
                                                            <p:graphicImage onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(6).getID()}');" value="#{c_DangTinController.item.hinhAnh.get(6).getFileHinhAnh()==null?(c_DangTinController.item.hinhAnh.get(6).getHinhAnh().trim()==''?'/Data/UserUpload/default.jpg':c_DangTinController.getFullPathHinhAnh(c_DangTinController.item.hinhAnh.get(6).getHinhAnh())):c_DangTinController.item.hinhAnh.get(6).getFileHinhAnh()}"  cache="false">

                                                            </p:graphicImage>
                                                        </a>
                                                        <a href="javascript:void(0)" onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(7).getID()}');">
                                                            <p:graphicImage onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(7).getID()}');" value="#{c_DangTinController.item.hinhAnh.get(7).getFileHinhAnh()==null?(c_DangTinController.item.hinhAnh.get(7).getHinhAnh().trim()==''?'/Data/UserUpload/default.jpg':c_DangTinController.getFullPathHinhAnh(c_DangTinController.item.hinhAnh.get(7).getHinhAnh())):c_DangTinController.item.hinhAnh.get(7).getFileHinhAnh()}"  cache="false">

                                                            </p:graphicImage>
                                                        </a>
                                                        <a href="javascript:void(0)" onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(8).getID()}');">
                                                            <p:graphicImage onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(8).getID()}');" value="#{c_DangTinController.item.hinhAnh.get(8).getFileHinhAnh()==null?(c_DangTinController.item.hinhAnh.get(8).getHinhAnh().trim()==''?'/Data/UserUpload/default.jpg':c_DangTinController.getFullPathHinhAnh(c_DangTinController.item.hinhAnh.get(8).getHinhAnh())):c_DangTinController.item.hinhAnh.get(8).getFileHinhAnh()}"  cache="false">

                                                            </p:graphicImage>
                                                        </a>
                                                        <a href="javascript:void(0)" onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(4).getID()}');">
                                                            <p:graphicImage onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(4).getID()}');" value="#{c_DangTinController.item.hinhAnh.get(4).getFileHinhAnh()==null?(c_DangTinController.item.hinhAnh.get(4).getHinhAnh().trim()==''?'/Data/UserUpload/default.jpg':c_DangTinController.getFullPathHinhAnh(c_DangTinController.item.hinhAnh.get(9).getHinhAnh())):c_DangTinController.item.hinhAnh.get(9).getFileHinhAnh()}"  cache="false">

                                                            </p:graphicImage>
                                                        </a>
                                                    </c:when>
                                                    <c:when test="#{c_DangTinController.item.goiDangTinID==3}">
                                                        <a href="javascript:void(0)" onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(0).getID()}');">
                                                            <p:graphicImage onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(0).getID()}');" value="#{c_DangTinController.item.hinhAnh.get(0).getFileHinhAnh()==null?(c_DangTinController.item.hinhAnh.get(0).getHinhAnh().trim()==''?'/Data/UserUpload/default.jpg':c_DangTinController.getFullPathHinhAnh(c_DangTinController.item.hinhAnh.get(0).getHinhAnh())):c_DangTinController.item.hinhAnh.get(0).getFileHinhAnh()}"  cache="false">

                                                            </p:graphicImage>
                                                        </a>
                                                        <a href="javascript:void(0)" onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(1).getID()}');">
                                                            <p:graphicImage onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(1).getID()}');" value="#{c_DangTinController.item.hinhAnh.get(1).getFileHinhAnh()==null?(c_DangTinController.item.hinhAnh.get(1).getHinhAnh().trim()==''?'/Data/UserUpload/default.jpg':c_DangTinController.getFullPathHinhAnh(c_DangTinController.item.hinhAnh.get(1).getHinhAnh())):c_DangTinController.item.hinhAnh.get(1).getFileHinhAnh()}"  cache="false">

                                                            </p:graphicImage>
                                                        </a>
                                                        <a href="javascript:void(0)" onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(2).getID()}');">
                                                            <p:graphicImage onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(2).getID()}');" value="#{c_DangTinController.item.hinhAnh.get(2).getFileHinhAnh()==null?(c_DangTinController.item.hinhAnh.get(2).getHinhAnh().trim()==''?'/Data/UserUpload/default.jpg':c_DangTinController.getFullPathHinhAnh(c_DangTinController.item.hinhAnh.get(2).getHinhAnh())):c_DangTinController.item.hinhAnh.get(2).getFileHinhAnh()}"  cache="false">

                                                            </p:graphicImage>
                                                        </a>
                                                        <a href="javascript:void(0)" onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(3).getID()}');">
                                                            <p:graphicImage onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(3).getID()}');" value="#{c_DangTinController.item.hinhAnh.get(3).getFileHinhAnh()==null?(c_DangTinController.item.hinhAnh.get(3).getHinhAnh().trim()==''?'/Data/UserUpload/default.jpg':c_DangTinController.getFullPathHinhAnh(c_DangTinController.item.hinhAnh.get(3).getHinhAnh())):c_DangTinController.item.hinhAnh.get(3).getFileHinhAnh()}"  cache="false">

                                                            </p:graphicImage>
                                                        </a>
                                                        <a href="javascript:void(0)" onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(4).getID()}');">
                                                            <p:graphicImage onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(4).getID()}');" value="#{c_DangTinController.item.hinhAnh.get(4).getFileHinhAnh()==null?(c_DangTinController.item.hinhAnh.get(4).getHinhAnh().trim()==''?'/Data/UserUpload/default.jpg':c_DangTinController.getFullPathHinhAnh(c_DangTinController.item.hinhAnh.get(4).getHinhAnh())):c_DangTinController.item.hinhAnh.get(4).getFileHinhAnh()}"  cache="false">

                                                            </p:graphicImage>
                                                        </a>

                                                        <a href="javascript:void(0)" onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(5).getID()}');">
                                                            <p:graphicImage onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(5).getID()}');" value="#{c_DangTinController.item.hinhAnh.get(5).getFileHinhAnh()==null?(c_DangTinController.item.hinhAnh.get(5).getHinhAnh().trim()==''?'/Data/UserUpload/default.jpg':c_DangTinController.getFullPathHinhAnh(c_DangTinController.item.hinhAnh.get(5).getHinhAnh())):c_DangTinController.item.hinhAnh.get(5).getFileHinhAnh()}"  cache="false">

                                                            </p:graphicImage>
                                                        </a>
                                                        <a href="javascript:void(0)" onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(6).getID()}');">
                                                            <p:graphicImage onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(6).getID()}');" value="#{c_DangTinController.item.hinhAnh.get(6).getFileHinhAnh()==null?(c_DangTinController.item.hinhAnh.get(6).getHinhAnh().trim()==''?'/Data/UserUpload/default.jpg':c_DangTinController.getFullPathHinhAnh(c_DangTinController.item.hinhAnh.get(6).getHinhAnh())):c_DangTinController.item.hinhAnh.get(6).getFileHinhAnh()}"  cache="false">

                                                            </p:graphicImage>
                                                        </a>
                                                        <a href="javascript:void(0)" onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(7).getID()}');">
                                                            <p:graphicImage onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(7).getID()}');" value="#{c_DangTinController.item.hinhAnh.get(7).getFileHinhAnh()==null?(c_DangTinController.item.hinhAnh.get(7).getHinhAnh().trim()==''?'/Data/UserUpload/default.jpg':c_DangTinController.getFullPathHinhAnh(c_DangTinController.item.hinhAnh.get(7).getHinhAnh())):c_DangTinController.item.hinhAnh.get(7).getFileHinhAnh()}"  cache="false">

                                                            </p:graphicImage>
                                                        </a>
                                                        <a href="javascript:void(0)" onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(8).getID()}');">
                                                            <p:graphicImage onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(8).getID()}');" value="#{c_DangTinController.item.hinhAnh.get(8).getFileHinhAnh()==null?(c_DangTinController.item.hinhAnh.get(8).getHinhAnh().trim()==''?'/Data/UserUpload/default.jpg':c_DangTinController.getFullPathHinhAnh(c_DangTinController.item.hinhAnh.get(8).getHinhAnh())):c_DangTinController.item.hinhAnh.get(8).getFileHinhAnh()}"  cache="false">

                                                            </p:graphicImage>
                                                        </a>
                                                        <a href="javascript:void(0)" onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(9).getID()}');">
                                                            <p:graphicImage onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(9).getID()}');" value="#{c_DangTinController.item.hinhAnh.get(9).getFileHinhAnh()==null?(c_DangTinController.item.hinhAnh.get(9).getHinhAnh().trim()==''?'/Data/UserUpload/default.jpg':c_DangTinController.getFullPathHinhAnh(c_DangTinController.item.hinhAnh.get(9).getHinhAnh())):c_DangTinController.item.hinhAnh.get(9).getFileHinhAnh()}"  cache="false">

                                                            </p:graphicImage>
                                                        </a>


                                                        <a href="javascript:void(0)" onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(10).getID()}');">
                                                            <p:graphicImage onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(10).getID()}');" value="#{c_DangTinController.item.hinhAnh.get(10).getFileHinhAnh()==null?(c_DangTinController.item.hinhAnh.get(10).getHinhAnh().trim()==''?'/Data/UserUpload/default.jpg':c_DangTinController.getFullPathHinhAnh(c_DangTinController.item.hinhAnh.get(10).getHinhAnh())):c_DangTinController.item.hinhAnh.get(10).getFileHinhAnh()}"  cache="false">

                                                            </p:graphicImage>
                                                        </a>
                                                        <a href="javascript:void(0)" onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(11).getID()}');">
                                                            <p:graphicImage onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(11).getID()}');" value="#{c_DangTinController.item.hinhAnh.get(11).getFileHinhAnh()==null?(c_DangTinController.item.hinhAnh.get(11).getHinhAnh().trim()==''?'/Data/UserUpload/default.jpg':c_DangTinController.getFullPathHinhAnh(c_DangTinController.item.hinhAnh.get(11).getHinhAnh())):c_DangTinController.item.hinhAnh.get(11).getFileHinhAnh()}"  cache="false">

                                                            </p:graphicImage>
                                                        </a>
                                                        <a href="javascript:void(0)" onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(12).getID()}');">
                                                            <p:graphicImage onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(12).getID()}');" value="#{c_DangTinController.item.hinhAnh.get(12).getFileHinhAnh()==null?(c_DangTinController.item.hinhAnh.get(12).getHinhAnh().trim()==''?'/Data/UserUpload/default.jpg':c_DangTinController.getFullPathHinhAnh(c_DangTinController.item.hinhAnh.get(12).getHinhAnh())):c_DangTinController.item.hinhAnh.get(12).getFileHinhAnh()}"  cache="false">

                                                            </p:graphicImage>
                                                        </a>
                                                        <a href="javascript:void(0)" onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(13).getID()}');">
                                                            <p:graphicImage onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(13).getID()}');" value="#{c_DangTinController.item.hinhAnh.get(13).getFileHinhAnh()==null?(c_DangTinController.item.hinhAnh.get(13).getHinhAnh().trim()==''?'/Data/UserUpload/default.jpg':c_DangTinController.getFullPathHinhAnh(c_DangTinController.item.hinhAnh.get(13).getHinhAnh())):c_DangTinController.item.hinhAnh.get(13).getFileHinhAnh()}"  cache="false">

                                                            </p:graphicImage>
                                                        </a>
                                                        <a href="javascript:void(0)" onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(14).getID()}');">
                                                            <p:graphicImage onclick="onclickUploadfile('#{c_DangTinController.item.hinhAnh.get(14).getID()}');" value="#{c_DangTinController.item.hinhAnh.get(14).getFileHinhAnh()==null?(c_DangTinController.item.hinhAnh.get(14).getHinhAnh().trim()==''?'/Data/UserUpload/default.jpg':c_DangTinController.getFullPathHinhAnh(c_DangTinController.item.hinhAnh.get(14).getHinhAnh())):c_DangTinController.item.hinhAnh.get(14).getFileHinhAnh()}"  cache="false">

                                                            </p:graphicImage>
                                                        </a>
                                                    </c:when>
                                                </c:choose>

                                                <p:remoteCommand name="cmdSetParamUploadFile"  
                                                                 actionListener="#{c_DangTinController.cmdSetParamUploadFile_Click}"></p:remoteCommand>
                                            </h:panelGroup>
                                        </div>
                                    </div>
                                </div>

                                <div class="col-md-4 scroll_Pkg">
                                    <div class="panel panel-default rounded-2x">
                                        <div class="panel-body">
                                            <h2 style="font-weight: bold;margin-bottom: 20px;">In Your Cart</h2>
                                            <div class="col-md-12">
                                                <div class="col-md-8">
                                                    <p style="color: #098AE4;font-size: 15px;">
                                                        <c:choose>
                                                            <c:when test="#{c_DangTinController.item.goiDangTinID==1}">
                                                                Free packages
                                                            </c:when>
                                                            <c:when test="#{c_DangTinController.item.goiDangTinID==2}">
                                                                Plus Package
                                                            </c:when>
                                                            <c:otherwise>
                                                                Premium Package
                                                            </c:otherwise>
                                                        </c:choose>
                                                    </p>
                                                </div>
                                                <div class="col-md-4">
                                                    <c:choose>
                                                        <c:when test="#{c_DangTinController.item.goiDangTinID==1}">
                                                            <span class="badge">$0.00</span>
                                                        </c:when>
                                                        <c:when test="#{c_DangTinController.item.goiDangTinID==2}">
                                                            <span class="badge">$20.00</span>
                                                        </c:when>
                                                        <c:otherwise>
                                                            <span class="badge">$49.00</span>
                                                        </c:otherwise>
                                                    </c:choose>
                                                </div>
                                            </div>
                                            <div class="col-md-12 margin-bottom-40" style="margin-bottom: 0px"><hr style="margin-top: 5px;margin-bottom: 5px"/></div>
                                            <div class="col-md-12">
                                                <div class="col-md-8">
                                                    <p style="font-weight: bold;color: #000000;font-size: 15px;">Subtotal</p>
                                                </div>
                                                <div class="col-md-4">
                                                    <c:choose>
                                                        <c:when test="#{c_DangTinController.item.goiDangTinID==1}">
                                                            <span style="font-weight: bold;color: #000000;">$0.00</span>
                                                        </c:when>
                                                        <c:when test="#{c_DangTinController.item.goiDangTinID==2}">
                                                            <span style="font-weight: bold;color: #000000;">$20.00</span>
                                                        </c:when>
                                                        <c:otherwise>
                                                            <span style="font-weight: bold;color: #000000;">$49.00</span>
                                                        </c:otherwise>
                                                    </c:choose>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <p:remoteCommand name="cmdGetListDoiXe" actionListener="#{c_DangTinController.cmd_getListDoiXe_Click}" update=":frmdangtin:pnDoiXe"></p:remoteCommand>
                                <p:remoteCommand name="cmdGetListTinh" actionListener="#{c_DangTinController.cmd_getListTinh_Click}" update=":frmdangtin:pnTinh"></p:remoteCommand>
                                <p:remoteCommand name="cmdsave" actionListener="#{c_DangTinController.cmd_Save_Click}" update=":frmdangtin"></p:remoteCommand>
                                <p:remoteCommand name="cmdSetParamUploadFile" actionListener="#{c_DangTinController.cmdSetParamUploadFile_Click}"></p:remoteCommand>
                            </h:form>
                        </div>

                    </div>
                    <div class="col-md-12">
                        <button class="btn-u btn-u-dark rounded-custom-def" onclick="btnSave_DangTin_Click();">
                                    <i class="fa fa-save"></i> #{utilsController.getLanguages('Save')}</button>
                                <a href="/Users/c/list-ad.html" class="btn-u btn-u-red rounded-custom-def">
                                    <i class="fa fa-times-circle"></i> #{utilsController.getLanguages('Cancel')}</a>
                    </div>
                </div>
            </div>
            <style type="text/css">
                .custom-input-group img{
                    width: 100px;
                    height: 100px;
                    margin-bottom: 5px;
                }
            </style>
            <script type="text/javascript">
                                $(function() {
                                    valTop = $('.scroll_Pkg').position().top;
                                    valLeft = $('.scroll_Pkg').position().left;
                                    $(window).scroll(function() {

                                        if ($(this).scrollTop() >= valTop) {
                                            $('.scroll_Pkg').addClass('pkg-fixed-top').css('left', valLeft);
                                        } else {
                                            $('.scroll_Pkg').removeClass('pkg-fixed-top').removeAttr('style');
                                        }
                                    });
                                });
            </script>
        </ui:define>
    </ui:composition> 
</html>